package com.company;

import java.util.Scanner;

/**
 Program to compute area of a circle.

 */

public class CircleCalculation2
{
    public static final double PI = 3.14159;                //final定义
                                                            //  final关键字可以用来修饰引用、方法和类。

    public static void main(String[] args)
    {
        double radius; //in inches
        double area;   //in square inches
        Scanner keyboard = new Scanner(System.in);

        System.out.println("Enter the radius of a circle in inches:");
        radius = keyboard.nextDouble( );
        area = PI * radius * radius;
        System.out.println("A circle of radius " + radius + " inches");
        System.out.println("has an area of " + area + " square inches.");
    }

}